const list = [
	'08:00',
	'08:30',
	'09:00',
	'09:30',
	'10:00',
	'10:30',
	'11:00',
	'11:30',
	'12:00',
	'12:30',
	'13:00',
	'13:30',
	'14:00',
	'14:30',
	'15:00',
	'15:30',
	'16:00',
	'16:30',
	'17:00',
	'17:30',
	'18:00',
	'18:30',
	'19:00',
	'19:30',
	'20:00',
	'20:30',
	'21:00'
]
export const timeList = ()=>{
	let itemList = []
	let result =[]
	list.map(item=>itemList.push({valueName:item,state:0}))
	result = itemList
	console.log('result2',result)
	return result
}
export const dateList = () => {
	console.log('----开始计算----')
	let result =[]
	const today = new Date(); // 获取当前日期
	const dates = [];
	for (let i = 0; i < 14; i++) { // 循环14次，每次增加一天
		const date = new Date(today); // 复制当前日期对象
		date.setDate(today.getDate() + i); // 增加天数
		const day = date.getDay(); // 获取星期数（0表示周日，1表示周一，以此类推）
		const weekday = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][day]; // 将数字转换为中文星期
		dates.push({
			date: formatDate(date), // 格式化日期
			time:formatDate(date,'time'),
			weekday: weekday
		});
	}
	result = dates
	console.log('----结束返回----',result)
	return result
}





// 格式化日期（可选）
function formatDate(date,type) {
	const year = date.getFullYear();
	const month = String(date.getMonth() + 1).padStart(2, '0');
	const day = String(date.getDate()).padStart(2, '0');
	if(type == 'time') return `${month}-${day}`;
	if(type == 'year') return `${year}`;
	return `${year}/${month}/${day} `;
}